import java.util.List; //line: 3
import com.zj.bean.*;
import java.util.*;
import org.rythmengine.template.TemplateBase;
import java.io.*;

public class act_command_html__R_T_C__ extends zj_zj_work_projects_all_mine_summerboot_html__main_template_html__R_T_C__ {//<extended_resource_key>C:/zj/zj_work_projects_all/mine/summerboot/html//main_template.html</extended_resource_key>

	public java.lang.String __getName() {
		return "act.command.html";
	}

	protected void __setup() {
		if (__isDefVal(commandList)) {commandList = __get("commandList",List.class) ;}
	}

	protected void __loadExtendingArgs() {
		__parent.__setRenderArg("menu", "opedncard"); //line: 1
	}

	protected List<Command> commandList=null; //line: 4

	protected java.lang.String __renderArgName(int __pos) {
		int __p = 0;
		if (__p++ == __pos) return "commandList";
		throw new ArrayIndexOutOfBoundsException();
	}

	protected java.util.Map<java.lang.String, java.lang.Class> __renderArgTypeMap() {
		java.util.Map<java.lang.String, java.lang.Class> __m = new java.util.HashMap<String, Class>();
		__m.put("commandList", List.class);
		__m.put("commandList__0", Command.class);
		return __m;
	}

	@SuppressWarnings("unchecked")
	public TemplateBase __setRenderArgs(java.util.Map<java.lang.String, java.lang.Object> __args) {
		if (null == __args) throw new NullPointerException();
		if (__args.isEmpty()) return this;
		super.__setRenderArgs(__args);
		if (__args.containsKey("commandList")) this.commandList = __get(__args,"commandList",List.class);
		return this;
	}

	@SuppressWarnings("unchecked") public TemplateBase __setRenderArgs(java.lang.Object... __args) {
		int __p = 0, __l = __args.length;
		if (__p < __l) { 
			Object v = __args[__p++]; 
			commandList = __safeCast(v, List.class); 
			__renderArgs.put("commandList",commandList);
		}
		return this;
	}

	protected java.lang.Class[] __renderArgTypeArray() {
		return new java.lang.Class[]{List.class, };
	}

	@SuppressWarnings("unchecked") @Override public TemplateBase __setRenderArg(java.lang.String __name, java.lang.Object __arg) {
		if ("commandList".equals(__name)) this.commandList = __safeCast(__arg, List.class);
		super.__setRenderArg(__name, __arg);
		return this;
	}

	@SuppressWarnings("unchecked") public TemplateBase __setRenderArg(int __pos, java.lang.Object __arg) {
		int __p = 0;
				if (__p++ == __pos) { 
			Object v = __arg; 
			commandList = __safeCast(v, List.class); 
			__renderArgs.put("commandList", commandList);
		}
		if(0 == __pos) __setRenderArg("arg", __arg);
		return this;
	}





	public org.rythmengine.utils.TextBuilder build(){
		buffer().ensureCapacity(7448);
p("<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<title>活动助手</title>\n<link rel=\"stylesheet\" href=\""); //line: 10
{ //line: 10
	org.rythmengine.template.ITag.__ParameterList _pl = null;  //line: 10
	_pl = new org.rythmengine.template.ITag.__ParameterList(); //line: 10
	_pl.add("","/static/css/bootstrap.min.css"); //line: 10
		__invokeTag(10, "res", _pl, false); //line: 10
} //line: 10
p("\">\n<link rel=\"stylesheet\" href=\""); //line: 11
{ //line: 11
	org.rythmengine.template.ITag.__ParameterList _pl = null;  //line: 11
	_pl = new org.rythmengine.template.ITag.__ParameterList(); //line: 11
	_pl.add("","/static/css/main.css"); //line: 11
		__invokeTag(11, "res", _pl, false); //line: 11
} //line: 11
p("\">\n</head>\n<body class=\"manage\">\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<i class=\"glyphicon glyphicon-bookmark pull-left\"></i>\n<h3 class=\"panel-title\">口令表管理</h3>\n</div>\n<div class=\"panel-body row table_content\">\n<form action=\"?\" class=\"form-inline row\" method=\"get\">\n<div class=\"form-group col-xs-4\" style=\"text-align: center;\">\n<label for=\"txtCardId\" class=\"control-label\">客户</label>\n<input name=\"cusName\" value=\""); //line: 23
{ //line: 23
	org.rythmengine.template.ITag.__ParameterList _pl = null;  //line: 23
		__invokeTag(23, "val", _pl, false); //line: 23
} //line: 23
p("\" type=\"text\" class=\"form-control\" id=\"txtCardId\" placeholder=\"客户\"/>\n<button type=\"submit\" class=\"btn btn-success\">查询</button>\n<input type=\"button\" id=\"addCmd\" class=\"btn btn-success\" value=\"新增\"/>\n</div>\n</form>\n<div style=\"padding: 50px 10px;width: 92%;margin: 0px auto;\">\n<table id=\"table_data\" class=\"table table-hover\">\n<thead>\n<tr>\n<th>库ID</th>\n<th>库名称</th>\n<th>客户名称</th>\n<th>刷新间隔</th>\n<th>剩余/总数</th>\n<th>状态</th>\n<th>增加口令</th>\n<th>导出剩余口令</th>\n</tr>\n</thead>\n<tbody>\n"); //line: 44

if (org.rythmengine.utils.Eval.eval(commandList != null)) { //line: 43
p(" "); //line: 45
{
__Itr<Command> __v0 = __Itr.valueOf(commandList); //line: 44
int cm_size = __v0.size(); //line: 44
if (cm_size > 0) { //line: 44
int cm_index = 0; //line: 44
for(Command cm : __v0) { //line: 44
cm_index++; //line: 44
boolean cm_isOdd = cm_index % 2 == 1; //line: 44
java.lang.String cm_parity = cm_isOdd ? "odd" : "even"; //line: 44
boolean cm_isFirst = cm_index == 1; //line: 44
boolean cm_isLast = cm_index >= cm_size; //line: 44
org.rythmengine.utils.RawData cm_sep = new org.rythmengine.utils.RawData(cm_isLast ? "" : ","); //line: 44
org.rythmengine.utils.RawData cm__sep = new org.rythmengine.utils.RawData(org.rythmengine.utils.S.escape(cm)+(cm_isLast ? "" : ",")); //line: 44
org.rythmengine.internal.LoopUtil cm_utils = new org.rythmengine.internal.LoopUtil(cm_isFirst, cm_isLast); //line: 44
org.rythmengine.internal.LoopUtil cm__utils = new org.rythmengine.internal.LoopUtil(cm_isFirst, cm_isLast, cm); //line: 44
__pushItrVar("cm", cm); //line: 44
p(" <tr>\n<td>"); //line: 46

try{pe(cm.getId());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 46
p("</td>\n<td>"); //line: 47

try{pe(cm.getCmdName());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 47
p("</td>\n<td>"); //line: 48

try{pe(cm.getCusName());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 48
p("</td>\n<td>"); //line: 49

try{pe(cm.getRefreshTime());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 49
p("</td>\n<td>"); //line: 50

try{pe(cm.getLeftNum());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 50
p("/"); //line: 50

try{pe(cm.getTotalNum());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 50
p("</td>\n<td>\n"); //line: 52

if (org.rythmengine.utils.Eval.eval(cm.getStatus() == 1)) { //line: 51
p(" 开启"); //line: 52
}else{
 //line: 53
p(" 暂停"); //line: 54
} //line: 55
p("\n</td>\n<td><a href=\"#\" onclick=\"imports('"); //line: 57

try{pe(cm.getId());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 57
p("','"); //line: 57

try{pe(cm.getCmdName());} catch (RuntimeException e) {__handleTemplateExecutionException(e);}  //line: 57
p("')\">导入</a></td>\n<td>导出</td>\n</tr>\n"); //line: 59

	__popItrVar();
	}
}
}
 //line: 60
} //line: 61
p(" </tbody>\n</table>\n</div>\n</div>\n</div>\n<div id=\"jsAuthor\" class=\"hidden\">\n<div class=\"row\">\n<h2 class=\"col-xs-12 text-danger text-center\"><span id=\"edit\"></span>口令库</h2>\n<form class=\"form-horizontal col-xs-9\" id=\"powerCard\">\n<input type=\"hidden\" id=\"id\" name=\"id\" value=\"-1\"/>\n<div class=\"form-group\">\n<label for=\"pwdAuthor\" class=\"col-xs-4 control-label\">口令库名称</label>\n<div class=\"col-xs-8\">\n<input type=\"text\" name=\"cmdName\" class=\"form-control\" id=\"cmdName\" placeholder=\"请输入口令库名称\">\n</div>\n</div>\n<div class=\"form-group\">\n<label for=\"pwdAuthor\" class=\"col-xs-4 control-label\">客户名称</label>\n<div class=\"col-xs-8\">\n<input type=\"text\" name=\"cusName\" class=\"form-control\" id=\"cusName\" placeholder=\"请输入客户名称\">\n</div>\n</div>\n<div class=\"form-group\">\n<label for=\"pwdAuthor\" class=\"col-xs-4 control-label\">更新间隔(分钟)</label>\n<div class=\"col-xs-8\">\n<input type=\"text\" name=\"refreshTime\" class=\"form-control\" id=\"refreshTime\" placeholder=\"分钟\">\n</div>\n</div>\n<div class=\"form-group\">\n<label for=\"pwdAuthor\" class=\"col-xs-4 control-label\">状态</label>\n<div class=\"col-xs-8\">\n<select name=\"statuss\" id=\"status\" class=\"form-control\">\n<option value=\"0\">暂停</option>\n<option value=\"1\">开启</option>\n</select>\n</div>\n</div>\n</form>\n</div>\n</div>\n<div id=\"jsAuthor2\" class=\"hidden\">\n<div class=\"row\">\n<h2 class=\"col-xs-12 text-danger text-center\">导入口令到口令库</h2>\n<form class=\"form-horizontal col-xs-9\" id=\"cmds\">\n<input type=\"hidden\" id=\"cmdId\" name=\"cmdId\" value=\"-1\"/>\n<div class=\"form-group\">\n<label for=\"pwdAuthor\" class=\"col-xs-4 control-label\">口令库名称</label>\n<div class=\"col-xs-4\">\n<span id=\"cm\"></span>\n</div>\n</div>\n<div class=\"form-group\">\n<label for=\"pwdAuthor\" class=\"col-xs-4 control-label\">口令</label>\n<div class=\"col-xs-8\">\n<input type=\"text\" name=\"cmdStr\" class=\"form-control\" id=\"cmdStr\" placeholder=\"请输入口令\">\n</div>\n</div>\n</form>\n</div>\n</div>\n"); //line: 124
p('<');p("script type=\"text/javascript\" src=\""); //line: 1
{ //line: 1
	org.rythmengine.template.ITag.__ParameterList _pl = null;  //line: 1
	_pl = new org.rythmengine.template.ITag.__ParameterList(); //line: 1
	_pl.add("","/static/js/jquery-1.10.2.min.js"); //line: 1
		__invokeTag(1, "res", _pl, false); //line: 1
} //line: 1
p("\">"); //line: 1
;__ctx.pushCodeType((org.rythmengine.extension.ICodeType)org.rythmengine.extension.ICodeType.DefImpl.JS.clone()); //line: 124
p("</script>");__ctx.popCodeType(); //line: 124
p("\n"); //line: 125
p('<');p("script type=\"text/javascript\" src=\""); //line: 1
{ //line: 1
	org.rythmengine.template.ITag.__ParameterList _pl = null;  //line: 1
	_pl = new org.rythmengine.template.ITag.__ParameterList(); //line: 1
	_pl.add("","/static/js/bootstrap.min.js"); //line: 1
		__invokeTag(1, "res", _pl, false); //line: 1
} //line: 1
p("\">"); //line: 1
;__ctx.pushCodeType((org.rythmengine.extension.ICodeType)org.rythmengine.extension.ICodeType.DefImpl.JS.clone()); //line: 125
p("</script>");__ctx.popCodeType(); //line: 125
p("\n"); //line: 126
p('<');p("script type=\"text/javascript\" src=\""); //line: 1
{ //line: 1
	org.rythmengine.template.ITag.__ParameterList _pl = null;  //line: 1
	_pl = new org.rythmengine.template.ITag.__ParameterList(); //line: 1
	_pl.add("","/static/js/main.js"); //line: 1
		__invokeTag(1, "res", _pl, false); //line: 1
} //line: 1
p("\">"); //line: 1
;__ctx.pushCodeType((org.rythmengine.extension.ICodeType)org.rythmengine.extension.ICodeType.DefImpl.JS.clone()); //line: 126
p("</script>");__ctx.popCodeType(); //line: 126
p("\n"); //line: 127
p("<script>");__ctx.pushCodeType((org.rythmengine.extension.ICodeType)org.rythmengine.extension.ICodeType.DefImpl.JS.clone()); //line: 127
p("\nvar appRoot=\""); //line: 128
{ //line: 128
	org.rythmengine.template.ITag.__ParameterList _pl = null;  //line: 128
	_pl = new org.rythmengine.template.ITag.__ParameterList(); //line: 128
	_pl.add("","/"); //line: 128
		__invokeTag(128, "url", _pl, false); //line: 128
} //line: 128
p("\";\n$(\"#table_data tr\").dblclick(function(){\nvar cmId = $(this).children('td').eq(0).text();\nvar cmName = $(this).children('td').eq(1).text();\nvar csName = $(this).children('td').eq(2).text();\nvar refreshTime = $(this).children('td').eq(3).text();\nvar status = $(this).children('td').eq(5).text();\nif(status.trim() == '开启')status = 1;\nelse status = 0;\n$(\"#id\").val(cmId);\n$(\"#cmdName\").val(cmName);\n$(\"#cusName\").val(csName);\n$(\"#refreshTime\").val(refreshTime);\n$(\"#status\").val(status);\n$(\"#edit\").text(\"修改\");\nutil.el.confirm(\"#jsAuthor\",function () {\nutil.request.post(\"/act/command.json\",{id:cmId,cmdName:$(\"#cmdName\").val(),cusName:$(\"#cusName\").val(),refreshTime:$(\"#refreshTime\").val(),status:$(\"#status\").val()},function(data){\n$(\"#jsBtnDrawMoney\").removeAttr(\"disabled\");\nutil.el.alert(\"修改成功!\");\nwindow.location.reload();\n});\n});\n});\n$(\"#addCmd\").click(function () {\n$(\"#edit\").text(\"新增\");\n$(\"#cmdName\").val(\"\");\n$(\"#cusName\").val(\"\");\n$(\"#refreshTime\").val(\"\");\nutil.el.confirm(\"#jsAuthor\",function () {\nutil.request.post(\"/act/command.json\",{id:-1,cmdName:$(\"#cmdName\").val(),cusName:$(\"#cusName\").val(),refreshTime:$(\"#refreshTime\").val(),status:$(\"#refreshTime\").val()},function(data){\n$(\"#jsBtnDrawMoney\").removeAttr(\"disabled\");\nutil.el.alert(\"添加成功!\");\nwindow.location.reload();\n});\n});\n});\nfunction imports(cmdId,cmdName){\n$(\"#cmdId\").val(cmdId);\n$(\"#cm\").text(cmdName);\nutil.el.confirm(\"#jsAuthor2\",function () {\nutil.request.post(\"/act/addCmd.json\",util.el.data(\"#cmds\"),function(data){\n$(\"#jsBtnDrawMoney\").removeAttr(\"disabled\");\nutil.el.alert(\"导入成功!\");\nwindow.location.reload();\n});\n});\n}\n"); //line: 176
p("</script>");__ctx.popCodeType(); //line: 176
p("\n</body>\n</html>"); //line: 178

		return this;
	}

}
